﻿// -----------------------------------------------------------------------
// <copyright file="VisibilityTester.cs" company="Intermedia.NET">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace RayDen.Library.Components {
    using System;
    using RayDen.Library.Core;
    using RayDen.Library.Core.Primitives;

    public class VisibilityTester {
        public RayInfo ray;

        public VisibilityTester(ref Point p1, ref Point p2)
        {
            this.ray = new RayInfo(p1, p2-p1, MathLab.RAY_EPSILON, 1f - MathLab.RAY_EPSILON);
        }

        public bool Unoccluded(Func<RayInfo, bool> intersection) {
            return !intersection(this.ray);
        }
    }
}
